<template>
  <div class="global-header" :style="title ? {width: '90%'} : {}">
    <div class='global-header-logo'>
      <img v-if="getServerBg.upPic.sysLogo.pic !== ''" :src="getServerBg.upPic.sysLogo.pic || loginLog" alt="">
    </div>
    <div class='global-header-logo-label'>
      <img class="global-header-logo-label-img" v-if="getServerBg.upPic.sysLabel.pic !== ''"
           :src="getServerBg.upPic.sysLabel.pic" alt="">
    </div>
  </div>
</template>

<script>
import {getParams} from "@/utils";
import {mapState} from 'vuex';

const {title} = getParams();

export default {
  name: "GlobalHeader",
  data() {
    return {
      title,
      loginLog: require('@/assets/images/login/keqiao/blueLogo.png')
    }
  },
  created() {
    this.$store.dispatch('getServerBg/getFiles');
  },
  computed: {
    ...mapState(['getServerBg'])
  }
}
</script>

<style scoped lang="less">
.global-header {
  display: flex;
  height: 100%;
  justify-content: space-between;
  align-items: center;
  line-height: normal;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  .global-header-logo-label {
    position: relative;
    height: 65px;
    .global-header-logo-label-img {
      width: 100%;
      height: 100%;
      padding: 0;
      margin: 0;
    }
  }
}
</style>
